<?php

/**
 * [PHPFOX_HEADER]
 */
defined('PHPFOX') or exit('NO DICE!');

class Sociallogin_Component_Controller_Index extends Phpfox_Component {

    public function process() {
        $sService = $this->request()->get('service');
        $sReturnUrl = Phpfox::getLib("url")->makeUrl('sociallogin') . "result/";
        $query = http_build_query(
                array(
                    'service' => $sService,
                    'returnurl' => $sReturnUrl,
                    'security_token' => Phpfox::getService('log.session')->getToken(),
                ));

        $url = trim(Phpfox::getParam('sociallogin.url_openid'), '/') . '/index.php?' . $query;

        header('Location: ' . $url);
    }

}

?>